package cn.tedu.charging.cost.controller;

import cn.tedu.charging.common.pojo.vo.JsonResult;
import cn.tedu.charging.common.pojo.param.ChargingProgressParam;
import cn.tedu.charging.common.pojo.vo.ChargingProgressVO;
import cn.tedu.charging.cost.service.CostService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Api(tags = "计价服务")
@RestController
@RequestMapping("cost/")
public class CostController {
    @Autowired
    private CostService costService;

    @PostMapping("calc")
    public JsonResult<ChargingProgressVO> doCalcPrice(@RequestBody ChargingProgressParam params){
       ChargingProgressVO chargingProgressVO = costService.doCalcPrice(params);
       return JsonResult.ok(chargingProgressVO);
    }
}
